
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 1543. -- 生成树计数 -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>1543: 生成树计数</h2><span class=green>Time Limit: </span>10 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>64 MB<br><span class=green>Submit: </span>152&nbsp;&nbsp;<span class=green>Solved: </span>69<br>[<a href='submitpage.php?id=1543'>Submit</a>][<a href='problemstatus.php?id=1543'>Status</a>][<a href='bbs.php?id=1543'>Discuss</a>]</center><h2>Description</h2><div class=content>给定一个连通的带边权的图（允许自环和重边），求不同的最小生成树个数。两个生成树不同当它们所用的边的序号不同，换句话说，重边算多次。

</div><h2>Input</h2><div class=content>第一行n,m，表示点数和边数(1<=n<=50000,1<=m<=100000)
下接m行，每行3个数k1,k2,w，表示k1和k2之间有一条权值为w 的边。

</div><h2>Output</h2><div class=content>仅一行一个数：生成树个数 mod 1000003（质数）

</div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>3 5<br />
1 2 6<br />
1 2 6<br />
2 3 6<br />
3 1 6<br />
3 3 8<br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>5<br />
注：不会存在5条及5条以上的边，他们的边权是相同的。<br />
<br />
样例解释：<br />
5棵生成树分别如下（边按输入顺序标号）：<br />
(1,3)   (2,3)  (1,4)  (2,4)  (3,4) <br />
5号边是自环。<br />
</span></div><h2>HINT</h2>
			<div class=content><p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search=HNOI2009集训Day3'>HNOI2009集训Day3</a></p></div><center>[<a href='submitpage.php?id=1543'>Submit</a>][<a href='problemstatus.php?id=1543'>Status</a>][<a href='bbs.php?id=1543'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
